Date: Tue, 14 Jan 1997 20:29:55 GMT
Server: NCSA/1.5
Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>No Title</TITLE>
</HEAD>
<BODY>
<meta name="description" value="No Title">
<meta name="keywords" value="hmwrk5">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
 <b> <H1> CS 112 - Introduction to Computer Science II <BR> 
 Spring Semester 1995 <BR> 
 Homework Number 5<BR> 
</H1></b>
<P>
   This homework is due on April 13. There is an extra credit exercise which is
optional except for honors students.
<P>
<OL><LI> Consider the following array of integers :
<P>
15, 9, 7, 5, 10, 4, 2, 3, 1
<P>
   Write down the array after each iteration (recursive call) of
<P>
<OL><LI> Quicksort
<P>
<LI> Merge Sort
<P>
</OL>
<P>
<LI> (Taken from ``Data Structures Using C'' by Tanenbaum et.al). A sort by
counting is performed as follows. Declare and array <em> count</em> and set <em>
count[i]</em> to the number of elements that are less than <em> x[i]</em>. Then place
<em> x[i]</em> in position <em> count[i]</em> of an output array. (However, beware of
the possibilities of equal elements.) Write a routine to sort an array <em> x</em>
of size <em> n</em> using this method. Write a program to test your routine.
<P>
<LI> (Extra credit.) Implement the Quicksort algorithm for two way linked
lists.
<P>
</OL><BR> <HR>
<UL> 
<LI> <!WA0><A NAME=tex2html3 HREF="http://www.cs.bu.edu/students/grads/oira/cs112/node1.html#SECTION00010000000000000000">   About this document ... </A>
</UL>
<BR> <HR>
<P><ADDRESS>
<I>Alberto Oliart <BR>
Sat Apr  8 18:07:10 EDT 1995</I>
</ADDRESS>
</BODY>
